Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sass-parser support for the @use rule #2389

Merged
merged 14 commits into from
Oct 23, 2024
Merged

Add sass-parser support for the @use rule #2389

merged 14 commits into from
Oct 23, 2024

Conversation

nex3
Copy link
Contributor

@nex3 nex3 commented Oct 16, 2024

No description provided.

@nex3 nex3 requested a review from Goodwine October 16, 2024 02:15
CHANGELOG.md Outdated
@@ -1,3 +1,7 @@
## 1.79.7
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if it is intended, 1.79.6 has not been released.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, thanks

If this would be placed before a string that would continue the
escape, it would also continue the identifier itself.
Also add `ConfiguredVariable.raws.name` per recent discussions.
The original names make sense in isolation, but we want them to match
our eventual `VarriableDeclaration` class. That class will need to
have names that are sufficiently distinctive from the PostCSS
`Declaration` type, so these prefigure that naming convention.
There's also a Declaration.variable in PostCSS u_u
lib/src/util/character.dart Outdated Show resolved Hide resolved
lib/src/util/character.dart Show resolved Hide resolved
lib/src/util/string.dart Show resolved Hide resolved
lib/src/util/string.dart Show resolved Hide resolved
comma?: boolean;

/**
* The whitespace between the final variable (or its trailing comma if it has
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can there be whitespace between the final variable and the comma? And if so, is that supposed to be stored in the raws for the variable? or for the config?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it's stored in ConfiguredVariableRaws.afterValue.

pkg/sass-parser/lib/src/configuration.ts Outdated Show resolved Hide resolved
pkg/sass-parser/lib/src/statement/use-rule.ts Outdated Show resolved Hide resolved
Comment on lines +125 to +127
} else if (this.defaultNamespace !== this.namespace) {
result += ' as ' + sassInternal.toCssIdentifier(this.namespace);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assuming that I parse @use 'foo' as foo, and then do myUse.raws.namespace = 'bar' so that the RawValue is "invalid".

Should this line still omit producing as foo?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, myUse.raws.namespace is strictly ignored if it doesn't match.

@nex3 nex3 requested a review from Goodwine October 19, 2024 01:32
pkg/sass-parser/lib/src/configuration.ts Outdated Show resolved Hide resolved
Co-authored-by: Carlos (Goodwine) <2022649+Goodwine@users.noreply.github.com>
@nex3 nex3 merged commit 473ddf9 into main Oct 23, 2024
35 checks passed
@nex3 nex3 deleted the parser-use branch October 23, 2024 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants